package com.ylfstu.collection_;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionFor {
    @SuppressWarnings({"all"})
    public static void main(String[] args) {
        Collection collection = new ArrayList();
        collection.add(new Book("三国演义", "罗贯中", 50.98));
        collection.add(new Book("水浒传", "施耐庵", 32.1));
        collection.add(new Book("西游记", "吴承恩", 20.1));

        //增强for(也可以在数组中使用)
        //增强for，底层仍然是迭代器
        //增强for可以理解成简化版的 迭代器遍历
        //快捷键 ： I
        for (Object  book: collection) {
            System.out.println(book);
        }



    }
}
